using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace QuanLyThuNgan
{
    public class ThuNgan
    {
        public static DataTable st_loaddichvu()
        {
            DataTable dt;
            try
            {
                //List<SqlParameter> sqlp = new List<SqlParameter>();
               // sqlp.Add(new SqlParameter("@sochungtu", sct));
                dt = Uit.it_SQL.getDataTable("usp_ThuNgan_LoaiDichVu", null, "");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        public static DataTable st_loadctdvcap1(int madmdv)// thuoc , dich vu y te,vat tu y te
        {
            DataTable dt;
            try
            {
                string _sql = string.Format("usp_phkham_ctloaddichvu_1_2 {0}",madmdv);
                dt = Uit.it_SQL.getDataTable(_sql,null,"");
               
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        public static DataTable st_loadctdvcap2_ptgp_all()// phau thuat - giai phau select all
        {
            DataTable dt= new DataTable();
            try
            {
                string _sql = string.Format("usp_phkham_childctdvptgp_all");
                dt = Uit.it_SQL.getDataTable(_sql, null, "");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        public static DataTable st_loadctdvcap2_ptgp(string loai)//phau thuat - giai phau
        {
            DataTable dt;
            try
            {
                string _sql = string.Format("usp_phkham_childctdvptgp '{0}'", loai);
                dt = Uit.it_SQL.getDataTable(_sql,null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        public static DataTable st_donvi_canlamsang()// lay don vi cua loai can lam sang
        {
            DataTable dt;
            try
            {
                dt = Uit.it_SQL.getDataTable("usp_phkham_ctdvcls_alldonvi",null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
         public static DataTable st_loaidichvu_ct_canlamsang_all()// lay don vi cua loai can lam sang
        {
            DataTable dt;
            try
            {
                dt = Uit.it_SQL.getDataTable("usp_phkham_ctdvcls_all",null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        
        public static DataTable st_loadctdvcap1_cls(string madv)//can lam sang cap 1 theo don vi
        {
            DataTable dt;
            try
            {
                string _sql = string.Format("usp_phkham_ctdvcls '{0}'",madv);
                dt = Uit.it_SQL.getDataTable(_sql,null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        public static DataTable st_loadctdvcap2_cls(string loaidvu)//can lam sang cap 2 theo don vi
        {
            DataTable dt;
            try
            {
                string _sql = string.Format("usp_phkham_childctdvcls '{0}'", loaidvu);
                dt = Uit.it_SQL.getDataTable(_sql,null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
        
        public static DataTable st_loadctdvcap2_cls_all()//can lam sang cap 2 theo don vi seelct All
        {
            DataTable dt;
            try
            {
                dt = Uit.it_SQL.getDataTable("usp_phkham_childctdvcls_all",null,"");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
    }
}
